package org.nf.db.util.result;

import org.nf.db.util.RowProcessor;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @author wangl
 * @date 2021/7/29
 */
public class BeanListHandler<T> extends AbstractListHandler<T>{

    private final Class<T> beanClass;

    public BeanListHandler(Class<T> beanClass) {
        this.beanClass = beanClass;
    }

    @Override
    public T handleRow(ResultSet rs) throws SQLException {
        return RowProcessor.toBean(rs, beanClass);
    }
}
